/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client.domain;

import Client.gui.Drawable;
import java.awt.image.BufferedImage;

/**
 *
 * @author Ripper
 */
public class ClientProjectile implements Drawable
{
    private double x;
    private double y;
    private double rotation;
    private Animation anim;
    private int id;
    
    public ClientProjectile(ClientGameSession session, int id, int looktype, double xx, double yy, double rot)
    {
        x = xx;
        y = yy;
        rotation = rot;
        this.id = id;
        try
        {
            anim = new Animation();
            int idx = 1;
            while(true)
            {
                BufferedImage bi = session.getCdc().getImage(looktype+"_frame"+idx);
                anim.addFrame(new Frame(bi, 200));
                idx++;
            }
        }catch(Exception ex) { }
        anim.startAnimation();
    }
    
    public int getId()
    {
        return id;
    }

    @Override
    public BufferedImage getImageToDraw() {
        return anim.getImage();
    }

    @Override
    public BufferedImage getImageToDrawWhenSelecting() {
        return anim.getImage();
    }

    @Override
    public double getX() {
        return x;
    }

    @Override
    public double getY() {
        return y;
    }

    @Override
    public int getHpprct() {
        return -1;
    }

    @Override
    public String getName() {
        return "";
    }

    @Override
    public double getRotation() {
        return rotation;
    }

    public void setX(double x) {
        this.x = x;
    }
    public void setY(double y) {
        this.y = y;
    }
    
}
